package com.rpcdemo.client;


import com.rpcdemo.client.impl.CnBlogClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * Either 'name' or 'value' must be provided in @FeignClient
 * No Feign Client for loadBalancing defined. Did you forget to include spring-cloud-starter-netflix-ribbon?
 * : Load balancer does not have available server for client: cnblog
 * 如果制定了url，则不能使用ribbon的轮询
 */
@FeignClient(name = "cnblog", url = "https://www.cnblogs.com", fallback = CnBlogClientFallback.class,
        fallbackFactory = CnBlogClientFallbackFactory.class)
public interface CnBlogClient {

    @GetMapping("/lijiale/p/")
    String queryProductByIds(@RequestParam String index);
}
